package net.hn.hnms.biz.gasext.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import net.hn.hnms.biz.api.mine.RemoteEquipmentService;
import net.hn.hnms.biz.gasext.domain.vo.StateTrendVo;
import net.hn.hnms.biz.gasext.service.GasExtractionService;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Author: PanSX
 * Date: 2022/8/13 14:25
 */
@Api(value = "瓦斯抽采监测制器", tags = {"瓦斯抽采监测"})
@RestController
@RequestMapping("/gas")
@RequiredArgsConstructor
public class GasExtractionController {

    //    private  final EquipmentService equipmentService;

    @Autowired
    private RemoteEquipmentService remoteEquipmentService;
    /**
     * 瓦斯抽采
     */
    @Resource
    private GasExtractionService gasExtractionService;

    @GetMapping("monitor")
    @ApiOperation("瓦斯抽采监测")
    @AutoSetMineCode
    public R<Map> monitor(@ApiParam(value = "煤矿编码") String mineCode) {
        String equtype = "gasext";
        return remoteEquipmentService.zdsb(equtype, "",mineCode);
//        return R.ok(equipmentService.queryCurrentByEquType(equtype, ""));
    }

    @GetMapping("trafficTrends")
    @ApiOperation("流量趋势")
    @AutoSetMineCode
    public R<StateTrendVo> trafficTrends(@RequestParam("value")@ApiParam(value = "1：周，2：月") String value,@ApiParam(value = "煤矿编码") String mineCode) {
        StateTrendVo stateTrendVo = gasExtractionService.trafficTrends(value,mineCode);
        return R.ok(stateTrendVo);

    }



}
